﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class _Default : System.Web.UI.Page
{
    BUS_News objN = new BUS_News();
    BUS_Images objI = new BUS_Images();
    BUS_Advertise objA = new BUS_Advertise();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            Tintonghop(10);
            Tincuabe(5, 3);
            Tintucchame(5,4);
            Thuvienanh();
            Slideshow(0);
            Page.Title = "Trường mầm non hoa hồng";
        }
    }
    public void Tintonghop(int top) 
    {
        rpttintuctonghop.DataSource = objN.News_getByTop(top);
        rpttintuctonghop.DataBind();
    }

    public void Tincuabe(int top, int type)
    {
        rpttintuccuabe.DataSource = objN.News_getDataByTopAndType(top, type);
        rpttintuccuabe.DataBind();
    }
    public void Tintucchame(int top, int type)
    {
        rpttintucchame.DataSource = objN.News_getDataByTopAndType(top, type);
        rpttintucchame.DataBind();
    }
    public void Thuvienanh()
    {
        rptthuvienanh.DataSource = objI.DAL_Images_getImagesAlbum();
        rptthuvienanh.DataBind();
    }
    public void Slideshow(int position)
    {
        rptslideshow.DataSource = objA.BUS_Advertise_getImagesByPosition(position);
        rptslideshow.DataBind();
    }
}
